<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
   //接收数据,验证身份,并返回页面
    <% 
     request.setCharacterEncoding("utf-8");
     String restaurant_id = request.getParameter("restaurant_id");
     String chef_pwd = request.getParameter("chef_pwd");
     
     boolean ret = false;
     
     javax.sql.rowset.WebRowSet rs = aa.db.DBTools.getRS("SELECT * FROM chef where restaurant_id='"+restaurant_id+"'");
     if(rs.next()){
    	 String rschef_pwd = rs.getString("chef_pwd");
    	 if(rschef_pwd.equals(chef_pwd)){
    		 //验证通过
        	 ret = true;
    		 
    	//写session,usserid
    	session.setAttribute("restaurant_id",restaurant_id);
    	session.setAttribute("chef_name",rs.getString("chef_name"));
    	    	
    	 }
     }
   if(ret){
	 //验证通过
  	 
   	System.out.println("ok"); 
   	response.sendRedirect("houchuindex.jsp");
    	
    }else{
    	 
    	 //密码错误
    	 System.out.println("False"); 
    	 
     
    response.sendRedirect("cheflogin.jsp");
     }
     
    %>
    
    
    
    
    
    
    
    
    
    
    
    
    
    